﻿class Main extends PqMain {
    public constructor() {
        super();
    }
    protected initBaseView() {
        Config.configList = [
            { "name": "img0", "targetPanel": "root", "type": "image", "x": 50, "y": 50, "url": "resource/assets/xq1.png", "category": "btn" },
            { "name": "img1", "targetPanel": "root", "type": "image", "x": 100, "y": 150, "url": "resource/assets/xq3.png", "category": "btn" },
            { "name": "img2", "targetPanel": "root", "type": "image", "x": 150, "y": 350, "url": "resource/assets/xq10.png", "category": "btn" },
            { "name": "img3", "targetPanel": "img2", "type": "image", "x": 100, "y": 50, "url": "resource/assets/xq11.png", "category": "img" },
            { "name": "txt", "targetPanel": "root", "type": "image", "x": 50, "y": 5,"text":"这是一个简单的DEMO","width":400,"height":100,"size":36,"color":"0xFF0000","category": "txt" }
        ];
        var n: number = Config.configList.length;
        for (var i: number = 0; i < n; i++) {
            if (Config.configList[i].category == "img" || Config.configList[i].category == "res" || Config.configList[i].category == "btn")Config.resList.push(Config.configList[i].url);
        }
        this.loadConfig();
    }
    protected initGame() {
        var g:Game = new Game();
        this.addChild(g);
    }
}